package cn.hf.mychat.constanst;

import lombok.AllArgsConstructor;

import lombok.Getter;
import org.apache.commons.text.StringSubstitutor;

import java.util.Map;

@Getter
@AllArgsConstructor
public enum Test {
    /**
     * 成功
     */
    SUCCESS("失败${success}"),

    /**
     * 失败
     */
    ERROR("成功${error}");

    private String templateContent;


    public static String convertTemplateContent(Map<String,Object> params,Test templateContent){
        String templateContent1 = templateContent.getTemplateContent();
        StringSubstitutor stringSubstitutor = new StringSubstitutor();
        return  stringSubstitutor.replace(templateContent1);
    }



}
